home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19970626-19970929
/
000147_news@newsmaster….columbia.edu _Tue Aug 12 12:21:57 1997.msg
< prev
next >
Wrap
Internet Message Format
|
1997-09-28
|
2KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA19508
for <kermit.misc@watsun.cc.columbia.edu>; Tue, 12 Aug 1997 12:21:56 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id MAA00527
for kermit.misc@watsun; Tue, 12 Aug 1997 12:21:55 -0400 (EDT)
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Kermit macro question
Date: 12 Aug 1997 16:21:54 GMT
Organization: Columbia University
Lines: 43
Message-ID: <5sq2j2$40p$1@apakabar.cc.columbia.edu>
References: <5soa33$9a8$1@gte1.gte.net>
NNTP-Posting-Host: watsun.cc.columbia.edu
Xref: news.columbia.edu comp.protocols.kermit.misc:7448
In article <5soa33$9a8$1@gte1.gte.net>, <dabolts@gte.net> wrote:
: Can you define/assign a macro that contains a variable in the name? For
: example:
:
: define \%a 1
: define MESS_\%a This is message 1
:
: where the macro should be named MESS_1 and contain "This is message 1"
:
It depends on which Kermit program you are talking about, and which version
of it. In the current versions of MS-DOS Kermit, Kermit 95, and C-Kermit,
the commands for this are _DEFINE and _ASSIGN, which do the same things as
their unprefixed counterparts, except that they allow construction of the
variable name in the manner you've shown:
define \%a 1
_define MESS_\%a This is message 1
echo \m(MESS_1)
However, in this case it looks like you are trying to simulate arrays, and
there is no need for that since we already have arrays:
declare \&m[20] ; Declare an array for 20 messages
define \&m[1] This is message 1
define \&m[2] This is message 2
etc...
And of course, the subscript can be a variable:
define \%a 1
define \&m[\%a] This is message 1
or even an expression:
define \%a 1
define \&m[(\%a+3)/2] This is message 1
The 1997 edition of "Using C-Kermit" explains the script and macro language
in detail, with lots of examples:
http://www.columbia.edu/kermit/ck60manual.html
- Frank